package edu.sctu.zcy.month201505.day20150520;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Created by user24 on 2015/5/20.
 */
public class DateTest {

    public static void main(String[] args) {

        Calendar calendar = Calendar.getInstance();

        Date date = calendar.getTime();

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        System.out.println("当前日期："+simpleDateFormat.format(date));

        Long time = calendar.getTimeInMillis();//得到当前秒数

        System.out.println("当前日期："+date);

        System.out.println("当前时间："+time);
    }
}
